// wiremock-db/src/main/java/com/github/tomakehurst/wiremock/db/service/JournalServiceFactory.java
package com.github.tomakehurst.wiremock.db.utils;

import com.github.tomakehurst.wiremock.db.service.JournalService;
import com.github.tomakehurst.wiremock.db.service.impl.JournalServiceImpl;

/**
 * db 模块接口工厂：供 common 模块获取 JournalService 实例
 * 核心：隐藏实现类，仅暴露接口
 */
public class JournalServiceFactory {

    /**
     * 获取 JournalService 实例（单例，避免重复创建）
     * @return JournalService 接口实例
     */
    public static JournalService getInstance() {
        // 此处可扩展：如通过配置动态选择实现、依赖注入等
        return JournalServiceHolder.INSTANCE;
    }

    // 静态内部类：单例懒加载
    private static class JournalServiceHolder {
        private static final JournalService INSTANCE = new JournalServiceImpl();
    }
}